home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pckermit.arc / PCKERM.COR < prev    next >
Encoding:
Text File  |  1980-01-01  |  16.8 KB  |  800 lines

  1. -!PCKERM.ASM_PCKERM.ASM
  2. -1,1
  3. ;    .XLIST
  4. -23,89
  5. IBMPC   EQU     0               ; For IBM PC conditional assembly.
  6. Z100    EQU    1        ; For Heath/Zenith Z-100
  7. STEVE   EQU     0               ; For Steve's homebrew assembly.
  8.  
  9. ; System dependent parameters
  10.  
  11. IF IBMPC
  12.  
  13. DEFESC  EQU     ']'-100Q        ; The default escape character.
  14.  
  15. MDMDAT    EQU    03F8H        ; Address of modem port (data)
  16. MDMSTS    EQU    03FDH        ; Address of modem port status
  17. MDMCOM    EQU    03FBH        ; Address of modem port command
  18.  
  19. MDMINP    EQU    1        ; Input ready bit
  20.  
  21. MDMINTV    EQU    0030H        ; Address of modem port interrupt vector
  22. MDMINTO    EQU    0EFH        ; Mask to enable interrupt for modem port
  23. MDMINTC    EQU    010H        ; Bit to set to disable interrupts for modem
  24. INTCONT    EQU    0021H        ; Address of 8259 interrupt controller ICW2-3
  25. INTCON1    EQU    0020H        ; Address of 8259 ICW1
  26. EOICOM    EQU    0064H        ; End of interrupt
  27. -97
  28. ; Interrupt types for extra system functions
  29.  
  30. BIOS    EQU     10H
  31. COMM    EQU    14H
  32. KEYB    EQU    16H
  33. ENDIF
  34.  
  35. IF Z100
  36.  
  37. DEFESC  EQU     '\'-100Q        ; The default escape character.
  38.  
  39. ; BIOS entry points
  40.  
  41. BIOS_SEG SEGMENT AT 40H        ; Define segment where BIOS really is
  42.  
  43.     ORG    6*3
  44. BIOS_AUXOUT LABEL FAR        ; AUX output routine
  45.  
  46.     ORG    26*3
  47. BIOS_AUXFUNC LABEL FAR        ; AUX: function
  48.  
  49. BIOS_SEG ENDS            ; End of BIOS segment defs
  50.  
  51. ; Function codes for BIOS_AUXFUNC
  52.  
  53. CHR_READ    EQU    1    ; Read character
  54. CHR_STATUS    EQU    2    ; Get status
  55.   CHR_SFGS    EQU    0    ; Get status subfunction
  56.   CHR_SFGC    EQU    1    ; Get config subfunction
  57. CHR_CONTROL    EQU    3    ; Control function
  58.  CHR_CFSU    EQU    0    ; Set new configuration parameters
  59.  
  60.  
  61. B00455    EQU    0        ; 45.5 baud
  62. B0050    EQU    1        ; 50 baud
  63. B0075    EQU    2        ; 75 baud
  64. B0110    EQU    3        ; 110 baud
  65. B01345    EQU    4        ; 134.5 baud
  66. B0150    EQU    5        ; 150 baud
  67. B0300    EQU    6        ; 300 baud
  68. B0600    EQU    7        ; 600 baud
  69. B1200    EQU    8        ; 1200 baud
  70. B1800    EQU    9        ; 1800 baud
  71. B2000    EQU    10        ; 2000 baud
  72. B2400    EQU    11        ; 2400 baud
  73. B4800    EQU    12        ; 4800 baud
  74. B9600    EQU    13        ; 9600 baud
  75. B19200    EQU    14        ; 19200 baud
  76. B38400    EQU    15        ; 38400 baud
  77. ENDIF
  78.  
  79. BELL    EQU     07Q
  80. TAB     EQU     11Q
  81. LF      EQU     12Q
  82. FF      EQU     14Q
  83. CR      EQU     15Q
  84. XON     EQU     21Q
  85. XOFF    EQU     23Q
  86. ESC     EQU     33Q
  87. DEL     EQU     177Q
  88. BS    EQU    08H
  89.  
  90. DOS     EQU     21H
  91.  
  92. CONIN   EQU     01H
  93. CONOUT  EQU     02H
  94. RDRIN   EQU     03H
  95. PUNOUT  EQU     04H
  96. LSTOUT  EQU     05H
  97. DCONIO  EQU     06H
  98. GTIOB   EQU     07H
  99. PRSTR   EQU     09H
  100. CONSTAT EQU     0BH
  101. OPENF   EQU     0FH
  102. CLOSF   EQU     10H
  103. SFIRST  EQU     11H
  104. SNEXT   EQU     12H
  105. DELF    EQU     13H
  106. READF   EQU     14H             ; Read from the file.
  107. WRITEF  EQU     15H
  108. MAKEF   EQU     16H
  109. SETDMA    EQU    1AH        ; Set disk transfer address
  110. CFLSZ   EQU     23H
  111.  
  112. MAXPKT  EQU     '~'-' '+2Q      ; Maximum size of a packet.
  113. MAXTRY  EQU     05Q             ; Default number of retries on a packet.
  114. IMXTRY  EQU     20Q             ; Default number of retries send initiate.
  115. DRPSIZ  EQU     5EH             ; Default receive packet size.
  116. DSPSIZ  EQU     20H             ; Default send packet size.
  117. DSTIME  EQU     08H             ; Default send time out interval.
  118. DRTIME  EQU     05H             ; Default receive time out interval.
  119. DSPAD   EQU     00H             ; Default send padding.
  120. DRPAD   EQU     00H             ; Default receive padding.
  121. DSPADC  EQU     00H             ; Default send padding char.
  122. DRPADC  EQU     00H             ; Default receive padding char.
  123. DSEOL   EQU     CR              ; Default send EOL char.
  124. DREOL   EQU     CR              ; Default receive EOL char.
  125. DSQUOT  EQU     '#'             ; Default send quote char.
  126. DRQUOT  EQU     '#'             ; Default receive quote char.
  127.  
  128. SOH     EQU     01H             ; Start of header char.
  129.  
  130. BUFSIZ  EQU     80H             ; Size of DMA.
  131. MAXFIL  EQU     50H             ; Maximum number of files allowed.
  132.  
  133. DIASW   EQU     01H             ; Default is diagnostics on.
  134.  
  135. CMKEY   EQU     01H             ; Parse a keyword.
  136. CMIFI   EQU     02H             ; Parse an input file spec (can be wild).
  137. CMOFI   EQU     03H             ; Parse an output file spec.
  138. CMCFM   EQU     04H             ; Parse a confirm.
  139.  
  140. -107,107
  141. versio  db      'CUCCA'
  142. IF IBMPC
  143.     db    ' IBM-PC'
  144. ENDIF
  145. IF Z100
  146.     db    '/Stevens Heath/Zenith Z-100'
  147. ENDIF
  148.     db    ' Kermit-86 - ver 1.0',cr,lf,
  149. -117,117
  150.     db    'type Ctrl-'
  151. IF IBMPC
  152.     db    ']'
  153. ENDIF
  154. IF Z100
  155.     db    '\'
  156. ENDIF
  157.     db    '-C to return to PC]',cr,lf,'$'
  158. -118:tmsg2    db    cr,lf,'[Back at micro]',cr,lf,'$'
  159.  
  160. -164,164
  161. IF IBMPC
  162.         db      cr,lf,'VT52-EMULATION$'
  163. ENDIF
  164. IF Z100
  165.     db    '$'
  166. ENDIF
  167. -169,169
  168. IF IBMPC
  169. bdhlp    db    cr,lf,'300   1200   1800   4800$'
  170. ENDIF
  171. IF Z100
  172. bdhlp    db    cr,lf,'45.5    50    75    110    134.5    150    300'
  173.     db    '    600    1200    1800'
  174.     db    cr,lf,'    2000    2400    4800    9600    19200    38400'
  175. ENDIF
  176. -177,184
  177. IF IBMPC
  178. vtemst  db      cr,lf,'VT52 emulation on$'
  179. novtst  db      cr,lf,'VT52 emulation off$'
  180. ENDIF
  181. ibmst   db      cr,lf,'IBM on$'
  182. noibm   db      cr,lf,'IBM off$'
  183. IF Z100
  184. b04st    db    cr,lf,'Baud rate is 45.5$'
  185. b05st    db    cr,lf,'Baud rate is 50$'
  186. b07st    db    cr,lf,'Baud rate is 75$'
  187. b11st    db    cr,lf,'Baud rate is 110$'
  188. b13st    db    cr,lf,'Baud rate is 134.5$'
  189. b15st    db    cr,lf,'Baud rate is 150$'
  190. ENDIF
  191. b03st    db    cr,lf,'Baud rate is 300$'
  192. IF Z100
  193. b06st    db    cr,lf,'Baud rate is 600$'
  194. ENDIF
  195. b12st    db    cr,lf,'Baud rate is 1200$'
  196. b18st    db    cr,lf,'Baud rate is 1800$'
  197. IF Z100
  198. b20st    db    cr,lf,'Baud rate is 2000$'
  199. b24st    db    cr,lf,'Baud rate is 2400$'
  200. ENDIF
  201. b48st    db    cr,lf,'Baud rate is 4800$'
  202. IF Z100
  203. b96st    db    cr,lf,'Baud rate is 9600$'
  204. b19st    db    cr,lf,'Baud rate is 19200$'
  205. b38st    db    cr,lf,'Baud rate is 38400$'
  206. ENDIF
  207. -191,191
  208. outlin  db      cr,lf,'     CUCCA'
  209. IF IBMPC
  210.     db    ' IBM-PC'
  211. ENDIF
  212. IF Z100
  213.     db    '/Stevens Heath/Zenith Z-100'
  214. ENDIF
  215.     db    ' Kermit-86 V1.0',
  216. -199,200
  217. IF IBMPC
  218. clrlin  db      cr,'$'            ; Clear line (just the cr part).
  219. ENDIF
  220. IF Z100
  221. clrlin    db    cr,esc,'K$'        ; Clear line on Z-100
  222. clrscr    db    esc,'H',esc,'J$'    ; Home and clear screen
  223. homcur    db    esc,'H$'        ; Home cursor
  224. ENDIF
  225. prsp    db    ' $'            ; Print a space.
  226.  
  227. ; Cursor addressing items
  228.  
  229. IF IBMPC
  230. -201:scrhi    dw    0434H            ; Err when 8th bit is on.
  231.  
  232. -224
  233. ENDIF
  234.  
  235. IF Z100
  236. scrhi    db    esc,'Y',23H,54H,lf,'$'    ; 8th bit on in character
  237. scrrpr    db    esc,'Y',27H,20H,'$'    ; Prompt when Kermit ends
  238. screrr    db    esc,'Y',26H,20H,'$'    ; Error messages
  239. scrfln    db    esc,'Y',25H,2CH,'$'    ; File name
  240. scrnrt    db    esc,'Y',23H,35H,lf,'$'    ; Number of retries
  241. scrnp    db    esc,'Y',23H,35H,'$'    ; Number of packets
  242. scrfr    db    esc,'Y',26H,20H,'$'    ; Rename file
  243. scrst    db    esc,'Y',23H,54H,'$'    ; Status
  244. scrsp    db    esc,'Y',28H,20H,'$'    ; send packet
  245. scrrp    db    esc,'Y',2AH,20H,'$'    ; Receive packet
  246. ENDIF
  247. -245,245
  248. IF IBMPC
  249. settab  db      07H             ; seven entries.
  250. ENDIF
  251. IF Z100
  252. settab    db    06H        ; Only six entries for Z-100
  253. ENDIF
  254. -258,259
  255. IF IBMPC
  256.         db      0EH,'VT52-EMULATION$'
  257.         dw      vt52em
  258. ENDIF
  259. -272
  260. IF IBMPC
  261. -281
  262. ENDIF
  263. IF Z100
  264. bdtab    db    010H        ; 16 entries
  265.     db    03H,'110$'
  266.     dw    b0110
  267.     db    04H,'1200$'
  268.     dw    b1200
  269.     db    03H,'134$'
  270.     dw    b01345
  271.     db    03H,'150$'
  272.     dw    b0150
  273.     db    04H,'1800$'
  274.     dw    b1800
  275.     db    05H,'19200$'
  276.     dw    b19200
  277.     db    04H,'2000$'
  278.     dw    b2000
  279.     db    04H,'2400$'
  280.     dw    b2400
  281.     db    03H,'300$'
  282.     dw    b0300
  283.     db    05H,'38400$'
  284.     db    b38400
  285.     db    02H,'45$'
  286.     dw    b00455
  287.     db    04H,'4800$'
  288.     dw    b4800
  289.     db    02H,'50$'
  290.     dw    b0050
  291.     db    03H,'600$'
  292.     dw    b0600
  293.     db    02H,'75$'
  294.     dw    b0075
  295.     db    04H,'9600$'
  296.     dw    b9600
  297. ENDIF
  298. -282: 
  299.  
  300. -324,324
  301. IF IBMPC
  302. vtflg   db      1               ; VT52 emulation flag (default on).
  303. ENDIF
  304. -339,339
  305. IF IBMPC
  306. baud    db    B4800        ; Use default of 4800.
  307. ENDIF
  308. IF Z100
  309. auxcnf    db    4 dup(?)    ; AUX port configuration info
  310. baud    db    ?        ; Baud rate
  311. auxcnf1    db    12 dup(?)    ; Rest of configuration info
  312. ENDIF
  313. -388,390
  314. -404
  315.         call cmblnk             ; Clear the screen.
  316.     call locate
  317.  
  318. -409,409
  319.     mov ah,setdma        ; Set disk transfer address.
  320. -410:    mov dx,offset buff
  321.  
  322. -413,413
  323. IF IBMPC
  324.     mov dx,mdmcom        ; LCR -- Initialize baud rate.
  325. -418,418
  326.     mov dx,mdmdat
  327. -424,426
  328.     mov dx,mdmcom
  329.     mov al,bl
  330.     out dx,al
  331. ENDIF
  332.  
  333. IF Z100
  334.     mov bx,ds        ; Set up pointer to config info
  335.     mov es,bx        ;  .  .  .
  336.     mov bx,offset auxcnf    ;  .  .  .
  337.     mov ah,chr_status    ; Get the function code
  338.     mov al,chr_sfgc        ; And the subfunction to get config
  339.     call bios_auxfunc    ; Get the block
  340. ENDIF
  341. -486
  342. IF IBMPC
  343. -491
  344. ENDIF
  345.  
  346. IF Z100
  347.     mov dx,offset screrr    ; Get address of string to position cursor
  348.     mov ah,prstr        ; Get the function code
  349.     int dos            ; Print the addressing string
  350.     ret            ; And return
  351. ENDIF
  352. -492:ERPOS    ENDP
  353.  
  354. -496
  355. IF IBMPC
  356. -501
  357. ENDIF
  358.  
  359. IF Z100
  360.     mov ah,prstr        ; Get the function to print string
  361.     mov dx,offset scrnrt    ; Get the address of the string
  362.     int dos            ; Print the string
  363.     ret            ; And return
  364. ENDIF
  365. -507
  366. IF IBMPC
  367. -511
  368. ENDIF
  369.  
  370. IF Z100
  371.     mov ah,prstr        ; Get the function to print string
  372.     mov dx,offset scrhi    ; Get the address of the string
  373.     int dos            ; Print the string
  374. ENDIF
  375. -618,618
  376. read2:
  377. IF IBMPC
  378.     mov ah,2        ; Position cursor.
  379. -619:    mov dx,scrst
  380.  
  381. -621
  382. ENDIF
  383. IF Z100
  384.     mov ah,prstr        ; Get print string function
  385.     mov dx,offset scrst    ; and string to move cursor
  386.     int dos            ; Print the string
  387. ENDIF
  388. -624
  389. IF IBMPC
  390. -628
  391. ENDIF
  392. IF Z100
  393.     mov ah,prstr        ; Get print string function
  394.     mov dx,offset scrnp    ; and string to move cursor
  395.     int dos            ; Print the string
  396. ENDIF
  397. -645
  398. IF IBMPC
  399. -649
  400. ENDIF
  401. IF Z100
  402.     mov ah,prstr        ; Get print string function
  403.     mov dx,offset scrst    ; and string to move cursor
  404.     int dos            ; Print the string
  405. ENDIF
  406. -650:        mov dx,offset infms3    ; Plus a little cuteness.
  407.  
  408. -652
  409. IF IBMPC
  410. -657,658
  411. ENDIF
  412. IF Z100
  413.     mov ah,prstr        ; Get print string function
  414.     mov dx,offset scrrpr    ; and string to move cursor
  415.     int dos            ; Print the string
  416. ENDIF
  417.         jmp rskp
  418. read6:
  419. IF IBMPC
  420.     mov ah,2        ; Position cursor.
  421. -661
  422. ENDIF
  423. IF Z100
  424.     mov ah,prstr        ; Get print string function
  425.     mov dx,offset scrst    ; and string to move cursor
  426.     int dos            ; Print the string
  427. ENDIF
  428. -664
  429. IF IBMPC
  430. -668
  431. ENDIF
  432. IF Z100
  433.     mov ah,prstr        ; Get print string function
  434.     mov dx,offset scrrpr    ; and string to move cursor
  435.     int dos            ; Print the string
  436. ENDIF
  437. -669:        jmp rskp
  438.  
  439. -1008,1008
  440. send2:
  441. IF IBMPC
  442.     mov ah,2                ; Position cursor.
  443. -1011
  444. ENDIF
  445. IF Z100
  446.     mov ah,prstr        ; Get print string function
  447.     mov dx,offset scrst    ; and string to move cursor
  448.     int dos            ; Print the string
  449. ENDIF
  450. -1014
  451. IF IBMPC
  452. -1018
  453. ENDIF
  454. IF Z100
  455.     mov ah,prstr        ; Get print string function
  456.     mov dx,offset scrnp    ; and string to move cursor
  457.     int dos            ; Print the string
  458. ENDIF
  459. -1042
  460. IF IBMPC
  461. -1043:    mov ah,2                ; Position cursor.
  462.  
  463. -1046
  464. ENDIF
  465. IF Z100
  466.     mov ah,prstr        ; Get print string function
  467.     mov dx,offset scrst    ; and string to move cursor
  468.     int dos            ; Print the string
  469. ENDIF
  470. -1049
  471. IF IBMPC
  472. -1054,1055
  473. ENDIF
  474. IF Z100
  475.     mov ah,prstr        ; Get print string function
  476.     mov dx,offset scrrpr    ; and string to move cursor
  477.     int dos            ; Print the string
  478. ENDIF
  479.         jmp rskp
  480. send8:
  481. IF IBMPC
  482.     mov ah,2                ; Position cursor.
  483. -1058
  484. ENDIF
  485. IF Z100
  486.     mov ah,prstr        ; Get print string function
  487.     mov dx,offset scrst    ; and string to move cursor
  488.     int dos            ; Print the string
  489. ENDIF
  490. -1061
  491. IF IBMPC
  492. -1062:    mov ah,2
  493.  
  494. -1065
  495. ENDIF
  496. IF Z100
  497.     mov ah,prstr        ; Get print string function
  498.     mov dx,offset scrrpr    ; and string to move cursor
  499.     int dos            ; Print the string
  500. ENDIF
  501. -1180
  502. IF IBMPC
  503. -1184
  504. ENDIF
  505. IF Z100
  506.     mov ah,prstr        ; Get print string function
  507.     mov dx,offset scrfln    ; and string to move cursor
  508.     int dos            ; Print the string
  509. ENDIF
  510. -1744
  511. IF IBMPC
  512. -1748
  513. ENDIF
  514. IF Z100
  515.     mov ah,prstr        ; Get print string function
  516.     mov dx,offset scrfln    ; and string to move cursor
  517.     int dos            ; Print the string
  518. ENDIF
  519. -1749:        mov ah,prstr            ; Print the file name.
  520.  
  521. -1762,1762
  522. gf8x:
  523. IF IBMPC
  524.     mov ah,2        ; Position cursor.
  525. -1765
  526. ENDIF
  527. IF Z100
  528.     mov ah,prstr        ; Get print string function
  529.     mov dx,offset scrfr    ; and string to move cursor
  530.     int dos            ; Print the string
  531. ENDIF
  532. -1921
  533. IF IBMPC
  534. -1925
  535. ENDIF
  536. IF Z100
  537.     mov ah,prstr        ; Get print string function
  538.     mov dx,offset scrsp    ; and string to move cursor
  539.     int dos            ; Print the string
  540. ENDIF
  541. -1959
  542. IF IBMPC
  543. -1960:outchr: mov al,ah               ; Char must be in al.
  544.  
  545. -1971
  546. ENDIF
  547.  
  548. IF Z100
  549. outchr:    mov al,ah        ; Yes, get the character into al
  550.     mov cx,0
  551.     cmp ibmflg,0        ; IBM mode?
  552.     je outch1        ; No, skip this
  553.     or al,080H        ; Yes, turn on parity bit
  554. outch1:    call bios_auxout    ; Send the character
  555. ENDIF
  556.  
  557. -1986,1989
  558. inchr:
  559. IF IBMPC
  560.     mov dx,mdmsts        ; Get port status.
  561.     in al,dx
  562.     test al,mdminp        ; Data available?
  563.     jnz inchr3        ; Read char ok.
  564. ENDIF
  565. IF Z100
  566.     push    bx        ; Save BX
  567.     mov ah,chr_status    ; Get the function
  568.     mov al,chr_sfgs        ; And the subfunction
  569.     call bios_auxfunc    ; Determine if anything to input
  570.     cmp bl,0        ; Is there?
  571.     jnz inchr3        ; Yes, go get it
  572.     pop bx            ; And restore BX
  573. ENDIF
  574. -2001,2002
  575.  
  576. inchr3:
  577. IF IBMPC
  578.     mov dx,mdmdat        ; Read in the char.
  579.     in al,dx
  580. ENDIF
  581. IF Z100
  582.     mov ah,chr_read        ; Get the function to read
  583.     call bios_auxfunc    ; Get a character
  584.     pop bx            ; Restore BX
  585. ENDIF
  586. -2016
  587. IF IBMPC
  588. -2020
  589. ENDIF
  590.  
  591. IF Z100
  592.     mov ah,prstr        ; Get the function to print string
  593.     mov dx,offset scrst    ; Get the string address
  594.     int dos            ; Position the cursor
  595. ENDIF
  596. -2021:    mov ah,prstr
  597.  
  598. -2174,2174
  599. IF IBMPC
  600. -2178
  601. ENDIF
  602. -2192
  603. IF IBMPC
  604. -2197,2199
  605.     mov bx,mdmintv
  606.     push [bx]        ; Serial Card Interrupt vector.
  607.     mov bx,mdmintv+2
  608. -2205,2205
  609.     mov bx,mdmintv
  610. -2206:    mov ax,offset serint
  611.  
  612. -2209,2209
  613.     mov bx,mdmintv+2
  614. -2227,2230
  615.     in al,intcont        ; Set up 8259 interrupt controller.
  616.     and al,MDMINTO        ; Enable INT4.
  617.     out intcont,al
  618.     mov dx,mdmcom        ; Set up baud, parity, etc.
  619. -2242,2242
  620. ENDIF
  621. IF Z100
  622.     mov ssp,sp        ; Save current stack pointer
  623. ENDIF
  624. telnoe: call plup        ; Char at port (type to console) ?
  625. IF IBMPC
  626. -2245
  627. ENDIF
  628. -2253
  629. IF IBMPC
  630. -2254:    cmp al,BELL
  631.  
  632. -2261
  633. ENDIF
  634. IF Z100
  635.     mov dl,al        ; Get the character
  636.     mov ah,dconio        ; and the function
  637.     int dos            ; type the character
  638.     jmp telnoe        ; Get next character
  639. ENDIF
  640. -2265
  641. IF IBMPC
  642. -2271,2273
  643.     in al,intcont        ; Interrupt control.
  644.     or al,mdmintc        ; Inhibit IRQ4.
  645.     out intcont,al
  646. -2283,2285
  647.     mov bx,mdmintv+2    ; Restore old interrupt vectors.
  648.     pop [bx]
  649.     mov bx,mdmintv
  650. -2289
  651. ENDIF
  652. IF Z100
  653.     mov sp,ssp
  654. ENDIF
  655. -2290:    mov ah,prstr
  656.  
  657. -2296
  658. IF IBMPC
  659. -2307,2311
  660.     mov dx,mdmsts        ; Asynch status port.
  661.     in al,dx
  662.     test al,mdminp        ; Data available?
  663.     jz retint        ; Nope.
  664.     mov dx,mdmdat
  665. -2325,2326
  666.     mov al,eoicom
  667.     out intcon1,al        ;Send End-of-Interrupt to 8259.
  668. -2332
  669. ENDIF
  670. -2340
  671.     nop            ; Make sure we have 3 bytes
  672. -2341:    jmp plup 
  673.  
  674. -2348
  675. IF IBMPC
  676. -2365
  677. ENDIF
  678. IF Z100
  679.     push bx            ; Save BX
  680.     mov ah,chr_status    ; Get the function we want
  681.     mov al,chr_sfgs        ; Get the subfunction to get status
  682.     call bios_auxfunc    ; Perform the function
  683.     cmp bl,0        ; Anything in queue?
  684.     jne prtch1        ; Yes, go get it
  685.     pop bx            ; Restore BX
  686.     jmp rskp        ; No, give skip return
  687.  
  688. prtch1:    mov ah,chr_read        ; Want to read character
  689.     call bios_auxfunc    ; Do it
  690.     and al,07FH        ; Strip off parity bit
  691.     pop bx            ; And restore BX
  692. ENDIF
  693. -2369
  694. IF IBMPC
  695. -2392,2393
  696. ENDIF
  697.  
  698. CONCHR  PROC    NEAR
  699. IF IBMPC
  700. -2414
  701. ENDIF
  702. IF Z100
  703.     mov ah,dconio        ; Determine if character present
  704.     mov dl,0ffH        ; Want input
  705.     int dos            ; Get status
  706.     cmp al,00H        ; Any characters there?
  707.     jne nobrk        ; if not, forget it
  708.     jmp rskp        ; Give skip return
  709. ENDIF
  710. -2415:
  711.  
  712. -2434
  713. IF IBMPC
  714. -2438
  715. ENDIF
  716. -2489,2490
  717. IF IBMPC
  718.     mov dx,mdmdat
  719.     out dx,al
  720. ENDIF
  721. IF Z100
  722.     call bios_auxout    ; Send the character
  723. ENDIF
  724. -2495
  725. IF IBMPC
  726. -2525
  727. ENDIF
  728. -2526:        jmp telnoe              ; Return home.
  729.  
  730. -2528
  731. IF IBMPC
  732. -2657
  733. ENDIF
  734. -2733
  735. IF IBMPC
  736. -2747
  737. ENDIF
  738. -2813
  739. IF IBMPC
  740. -2814:    mov dx,03FBH        ; LCR
  741.  
  742. -2827
  743. ENDIF
  744. IF Z100
  745.     mov bx,ds        ; Set up pointer to config info
  746.     mov es,bx        ;  .  .  .
  747.     mov bx,offset auxcnf    ;  .  .  .
  748.     mov ah,chr_control    ; Function is control
  749.     mov al,chr_cfsu        ; Subfunction is set new config
  750.     call bios_auxfunc    ; Set the configuration
  751. ENDIF
  752. -2848
  753. IF IBMPC
  754. -2854
  755. ENDIF
  756. -2872
  757. IF Z100
  758.     mov dx,offset b04st
  759.     cmp baud,B00455
  760.     jz stat9a
  761.     mov dx,offset b05st
  762.     cmp baud,B0050
  763.     jz stat9a
  764.     mov dx,offset b07st
  765.     cmp baud,b0075
  766.     jz stat9a
  767.     mov dx,offset b11st
  768.     cmp baud,B0110
  769.     jz stat9a
  770.     mov dx,offset b13st
  771.     cmp baud,B01345
  772.     jz stat9a
  773.     mov dx,offset b15st
  774.     cmp baud,B0150
  775.     jz stat9a
  776.     mov dx,offset b06st
  777.     cmp baud,B0600
  778.     jne stat9b
  779. stat9a:    jmp stat9
  780. stat9b:    mov dx,offset b20st
  781.     cmp baud,B2000
  782.     jz stat9
  783.     mov dx,offset b24st
  784.     cmp baud,B2400
  785.     jz stat9
  786.     mov dx,offset b96st
  787.     cmp baud,B9600
  788.     jz stat9
  789.     mov dx,offset b19st
  790.     cmp baud,B19200
  791.     jz stat9
  792.     mov dx,offset b38st
  793.     cmp baud,B38400
  794.     jz stat9
  795. ENDIF
  796. -3501
  797. IF IBMPC
  798. -3502:    mov ax,0920H               ; Write spaces.
  799.  
  800. -3505
  801. ENDIF
  802. -3617
  803. IF IBMPC
  804. -3622
  805. ENDIF
  806. IF Z100
  807.     mov ah,prstr        ; Get the function code
  808.     mov dx,offset clrscr    ; Want to clear the screen
  809.     int dos            ; Do it
  810. ENDIF
  811. -3628
  812. IF IBMPC
  813. -3632
  814. ENDIF
  815. IF Z100
  816.     mov ah,prstr        ; Function is print string
  817.     mov dx,offset homcur    ; Home cursor
  818.     int dos            ; do it
  819. ENDIF
  820. -3633:    ret
  821.  
  822.